﻿<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link href="../../css/default.css" rel="stylesheet" />
    <script src="../../js/globlaResource.js"></script>
</head>
<body>
    <ul id="menu" class="user-menu">
        <li>
            <table cellpadding="0" cellspacing="0" style="min-height:120px;max-height:120px">
                <tr>
                    <td id="caption" valign="middle" align="center">
                        <span class="font-size-30"></span>
                    </td>
                    <td valign="middle" align="center">
                        <img src="/Assets/icons/avatar.png" style="min-height: 80px; max-height: 80px" />
                    </td>
                </tr>
            </table>
            <ul class="dropdown">
                <li class="item">

                    <span class="font-size-30">{{$gRes.UserMenuBar.GotoPortal}}</span>
                </li>
                <li class="item">
                    <span class="font-size-30">{{$gRes.UserMenuBar.ChangeLanguage}}</span>
                    <ul class="dropdown">
                        <li class="item" ng-click="$$$ChangeLanguage('vn');"><span class="font-size-30">Tiếng Việt</span></li>
                        <li class="item" ng-click="$$$ChangeLanguage('en');"><span class="font-size-30">English</span></li>
                    </ul>
                </li>
                <li class="item" ng-click="doChangePassword();">
                    <span class="font-size-30">{{$gRes.UserMenuBar.ChangePassword}}</span>
                </li>
                <li class="item" ng-click="$$$doLogOut();">
                    <span class="font-size-30">
                        {{$gRes.UserMenuBar.SignOut}}
                        </span>

</li>
            </ul>
        </li>

    </ul>

    <script>
        "use strict";
        "user_menu.html";
        
        $($tmp.$e[0]).kendoMenu();
        $tmp.$s.$$$ChangeLanguage = function (code) {

            ngW8.$("$lang").$setLanguageCode(code);
            
            angular.forEach($tmp.$s.$root.$scopeList, function (f) {
                if (!f.$$destroyed) {
                    ngW8.$("$wslang").$apply(f);
                }
            });
            
        };
        $tmp.$s.$$$doLogOut = function () {
            ngW8.$("$store").$clear("UserInfo");
            ngW8.$("$loader").$load($tmp.$s.$root, "Commons/Login.html", function (loginScope, ele) {

                $("body").html("");
                ele.appendTo($("body")[0]);

            });
        };
        $tmp.$s.doChangePassword = function () {
            $tmp.$s.$root.$appView.loadView("user/changePassword.html", function (subScope) {
                if (!subScope.$$$caption) {
                    var menu = window.$navigator.menu;
                    var p = window.$navigator.module;
                    subScope.$$$caption = $tmp.$s.$$$res("ChangePassword", "Đổi mật khẩu", "UserMenu", "hubpage/hubpage.html");

                }
                subScope.$root.$session_header.$setCaption(subScope.$$$caption);
                $tmp.$s.$root.$header.$hide();
                $tmp.$s.$root.$session_header.$show();
            });
            
        };
        $tmp.$a.$observe("text", function (v) {
            $($tmp.$e[0]).find("#caption span").html(v);
        });
    </script>
</body>
<ul>
    <li>
        <span class="font-size-30" style="padding:4px;position:relative;top:-28px; min-height:120px !important" id="userMenu">
            {{$$$getUserInfo().UserID}}
        </span>

        <ul class="dropdown" id="dropdown">
            <li>
                <a class=" font-size-20" style="white-space:nowrap" ng-click="ChangePassword();">
                    {{$$$res("UserMenu.Đổi mật khẩu","Đổi mật khẩu","UserMenu")}}

                </a>
            </li>
            <li>
                <a class=" font-size-20" style="white-space:nowrap" ng-click="Config();">
                    {{$$$res("UserMenu.Thiết lập riêng","Thiết lập riêng","UserMenu")}}
                </a>
            </li>
            <li>
                <a class=" font-size-20" style="white-space:nowrap" ng-click="Logout();">
                    {{$$$res("UserMenu.Sign Out","Sign Out","UserMenu")}}
                </a>
            </li>
        </ul>
    </li>
</ul>
</html>